package cn.how2j.springcloud;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Controller
@RestController
public class BController {
	@Autowired
	SchedualServiceB SchedualServiceB;
	@Value("${server.port}")
	String port;

	@GetMapping(value = "/hi2")
	public String home(
			@RequestParam(value = "name", defaultValue = "forezp") String name) {
		return SchedualServiceB.sayHiFromClientOne(name) + " ,i am from port:"
				+ port;
	}

	@GetMapping(value = "/hi")
	public String home2(
			@RequestParam(value = "name", defaultValue = "forezp") String name) {
		return "hi bb " + name;
	}

}
